import request from '@/utils/request'

//获取教师作业
export function queryCourseList(teacherId){
  return request({
    url: '/topic/queryByTeacher/' + teacherId,
    method: 'post'
  })
}
export function saveTopic(data) {
  return request({
    url: '/topic/insert',
    method: 'post',
    data: data
  })
}
//添加题目
export function saveProblem(data){
  return request({
    url: '/problem/insert',
    method: 'post',
    data: data
  })
}

//获取教师作业
export function queryCourseListByCreator(creator){
  return request({
    url: '/topic/queryByCreator/' + creator,
    method: 'post'
  })
}
//通过title获取教师作业
export function queryidByTitle(title){
  return request({
    url: '/topic/queryByTitle/' + title,
    method: 'post'
  })
}
//通过作业标题获取作业id
export function queryByTopic(title){
  return request({
    url: '/topic/queryByTitle/' + title,
    method: 'post'
  })
}

//删除
export function DeleteTopic(id){
  return request({
    url: '/topic/delete/'+id,
    method: 'post'
  })
}
//发布
export function PutTopic(data){
  return request({
    url: '/topic/allocateForClass1',
    method: 'post',
    data:data
  })
}
//查询
export function queryTopicById(id){
  return request({
    url: '/topic/queryById/'+id,
    method: 'post'
  })
}
//修改发布时间
export function updateTime(data){
  return request({
    url: '/topic/update',
    method: 'post',
    data:data
  })
}
//查询课程
export function searchClass(id){
  return request({
    url: '/course/queryByTeacher/'+id,
    method: 'post'
  })
}
